{extend name="admin@template/base" /}
{block name="content"}
<div class="page-container">
    <div class="toptip">
    <h2>提示：</h2>
    <p>
      点击红色标签，停用已不属于单位人员的账号<br>
    </p>
</div>
<div class="cl pd-5 bg-1 bk-gray form-search">
<form class="mb-20" method="get" action="{:\\think\\Url::build($Request.action)}">
    <input type="text" class="input-text" style="width:60px" placeholder="姓名" name="realname" value="{$Request.param.realname}">
    <input type="text" class="input-text" style="width:90px" placeholder="身份证" name="username" value="{$Request.param.username}">
    <input type="text" class="input-text" style="width:90px" placeholder="手机" name="mobile" value="{$Request.param.mobile}">
    <input type="text" class="input-text" style="width:80px" placeholder="岗位" name="username" value="{$Request.param.username}">
    <div style="margin-top:1px;width:100px;" class="select-box sbox">
        <select name="companyid" class="select">
            <option value="">选择公司</option>
            {volist name='CompanyList' id='vo'}                     
            <option value="{$vo.id}" {$Request.param.companyid ==$vo.id ? 'selected' : ''}>{$vo.name}</option>
            {/volist}         
        </select>
    </div>

    <div style="margin-top:1px;width:100px;" class="select-box sbox">
        <select name="vface" class="select">
            <option value="">选择部门</option>
            {volist name='dments' id='voc'}                     
            <option value="{$voc.id}" {$Request.param.vface ==$voc.id ? 'selected' : ''}>{$voc.name}</option>
            {/volist}  
          
        </select>
    </div>

    <div style="margin-top:1px;width:100px;" class="select-box sbox">
        <select name="specialtyid" class="select" datatype="*" nullmsg="请选择所属分类">
            <option value>选择专业</option>                     
                        {volist name='specialtyList' id='vo'}                       
                        <option value="{$vo.id}" {$Request.param.specialtyid ==$vo.id ? 'selected' : ''}>{$vo.name}</option>
                        {/volist}
         </select>
    </div> 
  
    <button style="margin-top:2px;" type="submit" class="btn btn-success radius"><i class="Hui-iconfont">&#xe665;</i>查询</button>
</form>
</div>
<div class="page-container">
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            <!--<a href="javascript:;" onclick="clearUser('/admin/user/clearUser.html')" class="btn btn-danger radius mr-5"><i class="Hui-iconfont"></i> 清空人员</a>-->
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count}</strong> 条
        </span>
    </div>
    <input type="hidden" name="aaa" value="1">
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
            <tr class="text-c">
                <th class="table-id"><input type="checkbox">&nbsp;全选</th>
                <th class="table-status" style="width: 50px;">用户ID</th>
                <th class="table-status" style="width: 50px;">姓名</th>
                <th class="table-status" style="width: 100px;" >身份证号</th>
                <th style="width: 16%;">之前账号身份</th>
                <th style="width: 16%;">新的账号身份</th>
                <th style="width: 18%;">操作</th>
            </tr>
        </thead>
        <tbody>
            {volist name="record" id="vo"}
            <tr class="text-c">
                <td><input type="checkbox" name="id[]" value="{$vo.userid}"></td>
                <td class="table-status" style="width:50px;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$vo.userid}</td>
                <td class="table-status" style="width:50px;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$vo.username}</td>
                <td class="table-status" style="width:100px;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$vo.idcard}</td>
                <td style="width:18%;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$vo.previous_identity}</td>
                <td style="width:18%;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">{$vo.after_identity}</td>
                <td class="f-14">
                    <a href="javascript:;" onclick="offline('{$vo.previous_id}', '{$vo.id}', '/admin/user/offline.html')" class="label label-danger radius ml-5">使之前的账号时效</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page}</div>
</div>
<script type="text/javascript">
    function offline(id, oid, url) {
        $.ajax({
            url: url,
            type: 'post',
            data: {pid: id, oid: oid},
            dataType: 'json',
            success: function (data) {
                if (data.code == 0) {
                    layer.alert(data.msg, {icon: 6})
                }
                if (data.code == 1) {
                    layer.alert(data.msg, {icon: 5})
                }
            }
        });

    }
</script>
{/block}

